<?php
interface Strategy
{
    public function execute($a, $b);
}
class Context
{
    /** @var Strategy $strategy */
    public $strategy = null;
    /** @param Strategy $strategy */
    public function __construct($strategy)
    {
        $this->strategy = $strategy;
    }
    public function exec($a, $b)
    {
        return $this->strategy->execute($a, $b);
    }
}

class AStrategy implements Strategy
{
    public function execute($a, $b)
    {
        echo "$a + $b = " . ($a + $b) . "\r\n";
    }
}

$context = new Context(new AStrategy);
$context->exec(1,2);
